Upgrade to .NET 10, Aspire 13, and System.CommandLine 2.0#794
Merged
Upgrade to .NET 10, Aspire 13, and System.CommandLine 2.0#794
Conversation
4b4a827 to
f19e6dd
Compare
f19e6dd to
1f935d2
Compare
…le-chiseled-extra
…deJS and remove .esproj references
1f935d2 to
b53873f
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary & Motivation
Upgrade the codebase to .NET 10 and adopt new C# 14 language features.
Aspire.Hosting.JavaScriptover the deprecatedAspire.Hosting.NodeJS.mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled-extrafor projects using Entity Framework, andmcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseledfor AppGateway.System.CommandLineto 2.0.0 and migrate fromNamingConventionBinderto the newSetActionAPI.extension(Type param).fieldkeyword.paramskeyword from extension methods to avoid Roslyn compiler errors (dotnet/roslyn#80024).Downstream projects
Downstream projects must make the following changes to align with this upgrade:
Update all
*.csprojfiles to target .NET 10:Update all WebApp
.esprojfiles (e.g.,application/your-self-contained-system/WebApp/YourSystem.WebApp.esproj):Update Dockerfiles to use secure chiseled base images:
Remove WebApp
.esprojreferences from AppHost inapplication/AppHost/AppHost.csproj:- <ProjectReference Include="..\your-self-contained-system\WebApp\YourSystem.WebApp.esproj"/>With
Aspire.Hosting.JavaScriptusing the newAddJavaScriptApp()overAddNpmApp()eliminates the need for.esprojproject references in AppHost.Update
application/your-self-contained-system/Tests/EndpointBaseTest.csto use the newfieldkeyword for auto-implemented properties with backing fields:Also update the reference in
EndpointBaseTestconstructor:Fix extension method calls in SharedKernel that had the
paramskeyword removed due to Roslyn issue #80024:AddApiServices(),AddSharedInfrastructure(),AddWorkerServices(), and similar extension methods in SharedKernel no longer useparamsfor their assembly parameters.services.AddApiServices([assembly1, assembly2])instead ofservices.AddApiServices(assembly1, assembly2).application/your-self-contained-system/Api/Program.cs:If you have a custom developer CLI, update any custom commands to use System.CommandLine 2.0.0 syntax:
System.CommandLine.NamingConventionBinderwithSystem.CommandLine.Invocation.Handler = CommandHandler.Create<...>(Execute)withthis.SetAction(parseResult => Execute(...)).Options.Add()calls.developer-cli/Commands/CheckCommand.csfor a complete example.Optional: Adopt C# 14 features:
extension(Type param)syntax (seeapplication/shared-kernel/SharedKernel/ApiResults/ApiResultExtensions.csfor examples).fieldkeyword (see theEndpointBaseTest.cschange in step 5).Developers need to install .NET 10 SDK. Aspire's AppHost automatically handles SSL certificate creation and management when running the application locally. If you encounter certificate-related errors after upgrading, the AppHost will regenerate certificates automatically on the next run.
Checklist